#pragma once

class Timer 
{
public:
	Timer() 
	{
		Reset();
	}

	void Reset() 
	{
		unsigned __int64 pf;
		QueryPerformanceFrequency( (LARGE_INTEGER *)&pf );
		Freq = 1.0 / (double)pf;
		QueryPerformanceCounter( (LARGE_INTEGER *)&BaseTime );
	}

	double Seconds() 
	{
		unsigned __int64 val;
		QueryPerformanceCounter( (LARGE_INTEGER *)&val );
		return (val - BaseTime) * Freq;
	}

	double MilliSeconds() 
	{
		return Seconds() * 1000.0;
	}

private:
	double Freq;
	unsigned __int64 BaseTime;
};